package com.lufei4.chestnut.workspace.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lufei4.chestnut.R;
import com.lufei4.chestnut.workspace.bean.BeanInterests;

import java.util.List;

/**
 * @ProjectName: Chestnut
 * @Package: com.lufei4.chestnut.workspace.adapter
 * @ClassName: H5TestRightsAndInterestsAdapter
 * @Description: java类作用描述
 * @Author: liushijiang 15833013864@163.com
 * @CreateDate: 2021/1/14 13:31
 * @UpdateUser: 更新者：
 * @UpdateDate: 2021/1/14 13:31
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */

public class H5TestRightsAndInterestsAdapter extends BaseQuickAdapter<BeanInterests, BaseViewHolder> {
    public H5TestRightsAndInterestsAdapter(@Nullable List<BeanInterests> data) {
        super(R.layout.item_rights_and_interests, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeanInterests item) {
        ImageView imageView = (ImageView) helper.getView(R.id.iv_pic1);
//        Glide.with(mContext)
////                .setDefaultRequestOptions(new RequestOptions().centerCrop())
//                .load(ContextCompat.getDrawable(mContext,R.drawable.icon2))
//                .into(imageView);
        imageView.setImageDrawable(ContextCompat.getDrawable(mContext, item.resources));
        helper.setText(R.id.tv_name, item.name);
    }
}
